package exception;

import java.util.Scanner;

public class Exception4 {
    public static void main(String[] args) {
       try{
           System.out.println(getOne());
       }catch (Exception e){
           System.out.println(e);
       }
        System.out.println(11);
    }
    public static double getOne ()throws Exception{
        Scanner scanner = new Scanner(System.in);
        while (true){
            double i = scanner.nextDouble();
            try{
                if(i>=0){
                    return i;
                }else{
                    System.out.println("价格不对");
                }
            }catch (Exception e){
              throw   new intException("数据类型");
            }

        }
    }
}
